package com.example.springbootdemo.service.serviceImp;

import com.example.springbootdemo.entity.EsContent;
import com.example.springbootdemo.mapper.EsMapper;
import com.example.springbootdemo.service.EsService;
import org.dromara.easyes.core.biz.EsPageInfo;
import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
import org.elasticsearch.client.indices.GetIndexResponse;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: EsServiceImpl
 * @Description:
 * @Author: TXW
 * @Date: 2024-02-02
 */

@Service
public class EsServiceImpl implements EsService {

    @Resource
    private EsMapper esMapper;

    @Override
    public Boolean createIndex() {
       return esMapper.createIndex();
    }

    @Override
    public Integer insert(EsContent document) {
        return esMapper.insert(document);
    }

    @Override
    public List<EsContent> selectList(LambdaEsQueryWrapper<EsContent> wrapper) {
        return esMapper.selectList(wrapper);
    }

    @Override
    public GetIndexResponse getIndex() {
        return esMapper.getIndex();
    }

    @Override
    public EsPageInfo<EsContent> pageQuery(LambdaEsQueryWrapper<EsContent> wrapper, int pageNum, int pageSize) {
        return esMapper.pageQuery(wrapper,pageNum,pageSize);
    }
}
